package edu.csumb.itcd.teammario;

import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.geom.Point2D;

public class PoisonWeapon extends Weapon{
	
	private Poison poison;
	
	public PoisonWeapon(int damage, int rateOfFire, int duration)
	{
	super(damage, rateOfFire);
	damage = 1;
    lastShotTime = 0;
    poison = new Poison(damage, duration);
	}
	
	public void playerFire(Point start, Point destination)
	{
	    //Rate of fire check ie: higher rateOfFire slower you shoot
	    if (Game.gameCount >= lastShotTime + rateOfFire)
	    {
	        lastShotTime = Game.gameCount;
	        
	        Bullet bullet = new PoisonBullet(start, destination, damage, range, poison);
	        BulletList.addPlayerBullet(bullet);
	    }
	}
	public void towerFire(Point start, Point2D destination)
	{
	    //Rate of fire check ie: higher rateOfFire slower you shoot
	    if (Game.gameCount >= lastShotTime + rateOfFire)
	    {
	        lastShotTime = Game.gameCount;
	        //System.out.println("poison bullet out");
	        Bullet bullet = new PoisonBullet(start, destination, damage, range, poison);
	        
	        BulletList.addTowerBullet(bullet);
	    }
	}
	public void enemyFire(Point start, Point destination)
	{
	    //Rate of fire check ie: higher rateOfFire slower you shoot
	    if (Game.gameCount >= lastShotTime + rateOfFire)
	    {
	        lastShotTime = Game.gameCount;
	//        System.out.println(start + "  " + destination);
	        Bullet bullet = new PoisonBullet(start, destination, damage, range, poison);
	 //       System.out.println("poison bullet out");
	        BulletList.addEnemyBullet(bullet);
	    }
	}
	//public BulletList getBulletList()
	//{
	//    return bullets;
	//}

    public String getWeaponName()
    {
    	return "Poison Weapon";
    }

	public Poison getPoison() {
		return poison;
	}

	public void setPoisonDamage(int damage) {
		poison.setPoisonDamage(damage);
	}

	public void setPoisonDuration(int duration) {
		poison.setPoisonDuration(duration);
	}
	
	public int getPoisonDamage() {
		return poison.getPoisonDamage();
	}

	public int getPoisonDuration() {
		return poison.getPoisonDuration();
	}


	
}
